/*
 * mockPutQueue.cpp
 *
 */

#include "../common/StringUtils.h"
#include "../logger/logger.h"
#include "../channel_common/ChannelCommon.h"
#include "../IPC/MessageQueue.h"
#include "../middleware/CommunicationVendedor.h"

int main()
{
	std::string hostName = "vendedor_pc";

	middleware::CommunicationVendedor comm(hostName);

	middleware::CommunicationVendedor::VendedorRequestStruct req;

	req = comm.m_RequestQueue.get(2222);

	char buffer[1000];

	memcpy(buffer,&req,sizeof(req));

	std::cout<< "Demultiplexando mensaje de tamaño:"<<(sizeof(req))<<
				 " contenido"+StringUtils::toHexaString(buffer,sizeof(req))<<std::endl;


	std::cout<<"ClientId:"<<req.ordenCompra.clientId<<std::endl;
	std::cout<<"Cantidad:"<<req.producto.cantidad<<std::endl;
	std::cout<<"Tipo:"	<<req.producto.tipo<<std::endl;

	return 0;
}
